<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="${pageContext.request.contextPath }/resources/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/resources/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/resources/css/bootstrapValidator.min.css">
<script src="${pageContext.request.contextPath }/resources/js/jquery-1.11.1.min.js"></script>
<script src="${pageContext.request.contextPath }/resources/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/resources/js/bootstrapValidator.min.js"></script>
<link href="${pageContext.request.contextPath }/resources/css/common.css" rel="stylesheet">
<title>登录页面</title>
<script>
$(function() {
	$('#loginForm').bootstrapValidator({
		message: 'This value is not valid',
		feedbackIcons: {
			valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
       	 	userName: {
                validators: {
                    notEmpty: {
                        message : 'The username is required'
                    },
                    emailAddress : {
						message : '用户名必须是邮箱'
                    }
                }
			},
			userPassword: {
      			validators: {
             		notEmpty: {
              	 		message: 'The password is required'
              		},
              		identical : {
              			field : 'confirmPassword',
              			message : '两次密码不一致'
              		}
           		}
      		},
      		confirmPassword : {
      			validators: {
             		notEmpty: {
              	 		message: 'The password is required'
              		},
              		identical : {
              			field : 'userPassword',
              			message : '两次密码不一致'
              		}
           		}
      		}
  		}
	});
});
</script>
</head>
<body>
	<div class="col-lg-offset-5 col-lg-7">
		<h3>注册</h3>
	</div>
	<form id="loginForm" method="post" class="form-horizontal">
    	<div class="form-group">
        	<label class="col-lg-5 control-label sr-only" >用户名</label>
            <div class="col-lg-2">
            	<input type="text" class="form-control" name="userName" placeholder="用户名" />
    		</div>
    	</div>
	    <div class="form-group">
       	 	<label class="col-lg-5 control-label sr-only">密码</label>
       	 	<div class="col-lg-2">
            	<input type="password" class="form-control" name="userPassword" placeholder="密码"/>
            </div>
        </div>
       	<div class="form-group">
       	 	<label class="col-lg-5 control-label sr-only">密码</label>
       	 	<div class="col-lg-2">
            	<input type="password" class="form-control" name="confirmPassword" placeholder="密码"/>
            </div>
        </div>
	</form>
	<div class="col-sm-offset-5 col-sm-2">
		<button type="button" class="btn btn-primary btn-lg btn-block">注册</button>
	</div>
</body>
</html>
